//package com.genius.reservation.common;
//
//import cn.hutool.core.util.ObjectUtil;
//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.thirtydays.common.dao.BaseDao;
//import com.thirtydays.login.model.AdvertisingEntity;
//import org.springframework.stereotype.Repository;
//
///**
// * @Description :
// * @Date :  2020/10/22
// * @Author : zhangzhanheng
// */
//@Repository
//public interface AdvertisingEntityDao extends BaseDao<AdvertisingEntity> {
//
//    default AdvertisingEntity getByNearOne() {
//        LambdaQueryWrapper<AdvertisingEntity> queryWrapper = this.getQueryWrapper()
//                .select(AdvertisingEntity::getAdvertisingUrl,
//                        AdvertisingEntity::getAdvertisingJumpUrl,
//                        AdvertisingEntity::getAdvertisingType,
//                        AdvertisingEntity::getWaitTime)
//                .orderByDesc(AdvertisingEntity::getCreateTime)
//                .last("LIMIT 1");
//        return this.selectOne(queryWrapper);
//    };
//
//    default Page<AdvertisingEntity> getAll(Page<AdvertisingEntity> page1, String advertisingType, String createTime) {
//        LambdaQueryWrapper<AdvertisingEntity> queryWrapper = this.getQueryWrapper();
//        if (ObjectUtil.isNotEmpty(advertisingType)) {
//            queryWrapper.like(AdvertisingEntity::getAdvertisingType,advertisingType);
//        }
//        if (ObjectUtil.isNotEmpty(createTime)) {
//            queryWrapper.like(AdvertisingEntity::getCreateTime,createTime);
//        }
//        queryWrapper.orderByDesc(AdvertisingEntity::getCreateTime);
//        return this.selectPage(page1,queryWrapper);
//    };
//}
